<template>
  vuex
  <br /><br />
  <el-tag>当前count: {{ count }}</el-tag>
  <el-tag type="info">double: {{ double }}</el-tag>
  <br /><br />
  <el-button type="primary" @click="increment">increment</el-button>
  <el-button type="primary" @click="asyncIncrement">asyncIncrement</el-button>
</template>

<script lang="ts">
import { computed } from 'vue'
import { useStore } from 'vuex'

export default {
  setup() {
    const store = useStore()

    return {
      count: computed(() => store.state.count),
      double: computed(() => store.getters.double),
      increment: () => store.commit('increment'),
      asyncIncrement: () => store.dispatch('asyncIncrement')
    }
  }
}
</script>

<style></style>
